<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

  <xi:include href="tb-master.html" />

<head>
	<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
  	<title>${post.post_title}</title>
	<link rel="stylesheet" href="/css/galleriffic.css" type="text/css" />


  	<py:if test="post.post_address">
  	<!--
	<script >
	  	var map_var =  {
		'lat': ${post.post_address.google_lat},
		'lng': ${post.post_address.google_lng},
		'zoom': 7,
		'div': 'map_canvas',
	  	};
	 </script>
  	${tmpl_context.mapsimple_js()}
	  -->

  	  	${tmpl_context.googlemaps_js()}
  	<script>
	google.load("maps", "2");


	// Call this function when the page has been loaded
	function initialize() {
	  var map_var =  {
		'jsonurl': '/toolbox/post/get_placemarks',
		'div':'map_canvas',
		'zoom': 10,
		'lat': ${post.post_address.google_lat},
		'lng': ${post.post_address.google_lng},
	  };
	  var map = new google.maps.Map2(document.getElementById(map_var['div']));
	  map.setUIToDefault();
	  var point = new google.maps.LatLng(map_var['lat'], map_var['lng']);
	  map.setCenter(point, map_var['zoom']);
	  map.addOverlay(new google.maps.Marker(point));
	  var Wikipedia = new google.maps.Layer("org.wikipedia.it");
	  map.addOverlay(Wikipedia);
	  var Panoramio = new google.maps.Layer("com.panoramio.all");
	  map.addOverlay(Panoramio);
		}
	google.setOnLoadCallback(initialize);
  	</script>


    </py:if>

</head>
<body >
<div id="tabs" />
<h1>${post.post_title}</h1>
<span py:if="post.post_types.posttype_isevent">
${format_date(post.post_event_from, format='long', locale=get_lang()[0])} / ${format_date(post.post_event_to, format='long', locale=get_lang()[0])}
</span>
<table>
<tbody>
<tr>
	<td style="width:60%">

		<div id="post_content" class="ui-corner-all" >
		<blockquote>${post.post_description}</blockquote>
		<div>${XML(xml_content)}</div>
		</div>
	</td>
	<td style="width:40%">
		<div py:if="album" id="post_photos" class="ui-corner-all" >
		<h2>${album.title.text}</h2>
		<ul>
			<li><a href="${album.link[2].href}" target="_blank">Picasa</a></li>
			<li><a href="${album.link[2].href}#slideshow" target="_blank">Slideshow</a></li>
		</ul>
		<img py:for="i in album.entry" id="thumbnail" class="ui-corner-all" alt="${i.media.title.text}" src="${i.media.thumbnail[0].url}" />
		</div>
		<div id="post_map" py:if="post.post_address" class="ui-corner-all" >
			<h4>${post.post_address.google_address}</h4>
			<div id="map_canvas" style="width: 400px; height: 320px"></div>
		</div>
		<!-- <div id="post_slideshow" py:if="panoramio" class="ui-corner-all" >
			<h3>Panoramio</h3>
			<div id="slideshow">
			    <div py:for="p in panoramio.photos">
			    	<span>${p.photo_title}</span>
			        <a href="">
			        	<img src="${p.photo_file_url}" alt="${p.photo_title}" />
			        </a>
			    </div>
			</div>

		</div>
		 -->
	</td>
</tr>
</tbody>
</table>
<!--
<py:if test="panoramio">

<div id="gallery-adv" class="content">
	<div id="controls-adv" class="controls"></div>
	<div id="loading-adv" class="loader"></div>
	<div id="slideshow-adv" class="slideshow"></div>
	<div id="caption-adv" class="embox"></div>
</div>
<div id="thumbs-adv" class="navigation">
	<ul class="thumbs noscript">
		<li py:for="p in panoramio.photos">
			<a class="thumb" href="${p.photo_file_url}" title="${p.photo_title}">
				<img src="${p.photo_file_url.replace('/medium/','/thumbnail/')}" alt="${p.photo_title}" />
			</a>
			<div class="caption">
				<div class="download">
					<a href="${p.photo_url}">Download Original</a>
				</div>
				<div class="image-title">${p.photo_title}</div>

				<div class="image-desc">${p.owner_name}</div>
			</div>
		</li>
	</ul>
</div>

</py:if>
-->
<script type="text/javascript" src="/js/gallerific.js"></script>
</body>
</html>
